package models

import "gorm.io/gorm"

type Order struct {
	gorm.Model
	UserId      int     `gorm:"type:int(11);not null;comment:用户ID"`
	OrderSn     string  `gorm:"type:varchar(100);not null;comment:用户编号"`
	OrderTotal  float64 `gorm:"type:decimal(10,2);not null;comment:订单编号"`
	OrderStatus int     `gorm:"type:int(11);not null;default:1;comment:0 未支付 1已支付 2支付取消 3已完成"`
}

func (o *Order) List() (orderList []*Order, err error) {
	err = DB.Debug().Find(&orderList).Error
	return
}
